package com.github.kezhenxu94.playground.java.newfeatures.lambda;

import org.junit.Test;

import java.util.Arrays;
import java.util.List;

import static java.util.stream.Collectors.toList;

/**
 * Created by com.ikezhenxu.java.study on 4/11/15.
 */
public class FunctionTest {

	@Test
	public void function () {
		Integer[] integers = { 1, 2, 3, 45, 6, 7, 8, 5, 3, 2, 42, 34, 234, 423, 42, 3423, 423, 4, };
		List<Integer> integerList = Arrays.asList ( integers );
		integerList.forEach ( integer -> System.out.print ( integer + " " ) );
		integerList = integerList.stream ().map ( integer -> integer + 1 ).collect ( toList() );
		System.out.println ();
		integerList.forEach ( integer -> System.out.print ( integer + " " ) );
	}
}
